<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>

<script type="text/javascript">
$(function() {
		
		$("#pager").pager({ pagenumber: ${visitorModel.currentPage}, 
			pagecount: ${visitorModel.totalPage},
			buttonClickCallback: function(page){
				$("#content_detail").load("friendVisitor.htm?page="+page);
			} 
		});
		
	});
	
	function friendVisitor(type){
		if(type=='1'){
			$("#content_detail").load("friendVisitor.htm");
		}else if(type=='2'){
			$("#content_detail").load("friendVisitorFamily.htm");
		}
	}
</script>
<div class="h_main2">
	<div class="h_data">
		<h2>
			我家的邻居
		</h2>
		<div class="h_newNews">
			<ul>
				<li id="newNews1" onclick="friend();">
					<a>我家的邻居</a>
				</li>
				<li id="newNews2" class="h_newNewsHover">
					<a>访问脚印</a>
				</li>
				<!-- 
					<span><a href="#">邀请朋友加入</a> </span>
					 -->
				<div class="clear"></div>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="h_newNews_box">
			<div class="h_newNews_text" id="con_newNews_1"
				style="display: block;">
				<div class="data_h_newNews_nav">
					<a href="javascript:void(0);" class="current"
						id="friend_visitor_member">谁来看过我家</a>|
					<a id="friend_visitor_family" href="javascript:void(0);"
						onclick="friendVisitor('2');">我去看过谁家</a>
				</div>
				<div id="friend_visitor">
					<div class="h_friends_list">
						<c:choose>
							<c:when test="${visitorModel.totalRecord < 1}">
								<div style="margin-left: 15px;font-size: 14px;margin-top: 10px;">目前还没有街坊来串门</div>
							</c:when>
							<c:otherwise>
								<ul>
									<c:forEach items="${visitorModel.list}" var="visitor">
										<li>
											<div class="newsList_img2 fl"
												onclick="seeOtherFamily('${visitor.family}')">
												<div class="own_img">
													<img src="${visitor.avatar}" width="58" height="58"
														alt="我的邻居" />
												</div>
												<div class="others_img">
													<img src="${visitor.familyAvatar}" width="30" height="30"
														alt="果果街" />
												</div>
											</div>
											<a href="javascript:void(0);"><c:out
													value="${visitor.visitUsername}" /> </a>
											</h4>
											<em>来访：<fmt:formatDate value="${visitor.gmtModified}" pattern="MM月dd日" /></em>
										</li>
									</c:forEach>
		
		
									<div class="clear"></div>
								</ul>
							</c:otherwise>
						</c:choose>
						
						<div class="clear"></div>
					</div>
					<c:if test="${visitorModel.totalRecord > 0}">
						<div class="h_page" id="pager"></div>
					</c:if>
					
				</div>
				<div class="clear"></div>

			</div>

		</div>
	</div>
</div>
